/*
* Purpose: axonnet timer management
* Created: 2012-03-05 Daly 
*/

#ifndef _XNT_TIMER_H_
#define _XNT_TIMER_H_


#ifdef __cplusplus
extern "C" {
#endif

typedef void (*xnt_timer_proc)(int handle);

//timer wheel
struct timer_entry {
	int handle;
	xnt_timer_proc func; 
	unsigned int trigger_tick;
	timer_entry *next;
	timer_entry *wheel_next;
};

//entry in timer_wheel
struct timer_wheel_entry {
	int handle;
	timer_wheel_entry *next;
};

int xnt_add_timer(xnt_timer_proc timeout_cb, int timeout);
int xnt_del_timer(int handle_id);
int xnt_get_timepass();
void timer_table_init();
void xnt_timer_routine();

#ifdef __cplusplus
}
#endif

#endif
